package com.ex.mzwqz.util;

import android.app.Activity;
import android.content.Intent;

import com.ex.mzwqz.activity.CheckActivity;
import com.ex.mzwqz.activity.MainActivity;
import com.ex.mzwqz.activity.NewsActivity;
import com.ex.mzwqz.activity.StatisticsActivity;
import com.ex.mzwqz.activity.WebViewActivity;

/**
 * Created by xiaguoqiang on 16/10/19.
 */
public class UiManager {

    public static void toMainView(Activity activity,int userType){
        Intent i = new Intent(activity, MainActivity.class);
        i.putExtra(Constants.REQUEST_TYPE_USER_TYPE,userType);
        activity.startActivity(i);
    }

    public static void toInfoManager(Activity activity,int type){
        Intent i = new Intent(activity, NewsActivity.class);
        i.putExtra(Constants.REQUEST_TYPE_INFO_TYPE,type);
        activity.startActivity(i);
    }

    public static void toWebView(Activity activity,String title,String url){
        Intent i = new Intent(activity, WebViewActivity.class);
        i.putExtra(Constants.KEY_WEBVIEW_URL,url);
        i.putExtra(Constants.KEY_WEBVIEW_TITLE,title);
        activity.startActivity(i);
    }

    public static void toCheckManagerView(Activity activity,int status){
        Intent i = new Intent(activity, CheckActivity.class);
        i.putExtra(Constants.REQUEST_TYPE_CHECK_STATUS,status);
        activity.startActivity(i);
    }

    public static void toStatisticsView(Activity activity){
        Intent i = new Intent(activity, StatisticsActivity.class);
        activity.startActivity(i);
    }
}
